//file profil.js
var n = 0;

function show(obj){
	var div = document.getElementById(obj);
	div.style.display = '';
}

function hide(obj){
	var div = document.getElementById(obj);
	div.style.display = 'none';
}

function editFunction(current, formInput, editLink, cancelLink, submitSave){
	hide(current);
	show(formInput);
	hide(editLink);
	show(cancelLink);
	show(submitSave);
	n = n+1;
}

function cancelFunction(current, formInput, editLink, cancelLink, submitSave){
	n = n-1;
	show(current);
	hide(formInput);
	show(editLink);
	hide(cancelLink);
	if (n==0) {hide(submitSave);}
}

function editAvatarFunction(formInput, editLink, cancelLink, submitSave){
	show(formInput);
	hide(editLink);
	show(cancelLink);
	show(submitSave);
	n = n+1;
}

function cancelAvatarFunction(formInput, editLink, cancelLink, submitSave){
	n = n-1;
	hide(formInput);
	show(editLink);
	hide(cancelLink);
	if (n==0) {hide(submitSave);}
}
